package com.lbw.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lbw.entity.Subject;
import com.lbw.entity.SubjectEntity;
import com.lbw.result.Result;
import com.lbw.result.ResultFactory;
import com.lbw.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lbw
 * @since 2020-12-01
 */
@RestController
@RequestMapping("/subject")
@Api(tags = "科目配置")
public class SubjectController {

    @Autowired
    private SubjectService subjectService;

    /**
     * 获取所有科目配置信息
     * @return
     */
    @GetMapping("selectSubject")
    @ApiOperation("获取所有科目配置信息")
    public Result selectSubject() {
        List<Subject> entityList = subjectService.list(null);
        if (entityList != null && !entityList.isEmpty()) {
            return ResultFactory.success(entityList);
        }
        return ResultFactory.fail("暂无科目！");
    }


}

